<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%@include file="../../WEB-INF/jspf/admin.jspf" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="../../jq/redmond/jquery-ui-1.10.3.custom.min.css" type="text/css" rel="stylesheet"/>
        <link href="../../css/main.css" type="text/css" rel="stylesheet"/>
        <link href="../../jq/menu/menu.css" type="text/css" rel="stylesheet"/>
        <link href="../../jq/menu/submenu.css" type="text/css" rel="stylesheet"/>

        <link href="../../parainfo/form/form.css" type="text/css" rel="stylesheet"/>
        <link href="../../parainfo/table/table.css" type="text/css" rel="stylesheet"/>

        <script src="../../jq/jquery-1.10.2.min.js" type="text/javascript"></script>
        <script src="../../jq/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
        <script src="../../jq/i18n/jquery.ui.datepicker-es.min.js" type="text/javascript"></script>
        <script src="../../jq/menu/menu.js" type="text/javascript"></script>
        <script src="../../jq/menu/submenu.js" type="text/javascript"></script>

        <script src="../../parainfo/form/form.js" type="text/javascript"></script>
        <script src="../../parainfo/table/table.js" type="text/javascript"></script>
        <script src="js/horarios_asi.js" type="text/javascript"></script>
    </head>
    <body>
        <div id="ctop">
            <%@include file="../../WEB-INF/jspf/top.jspf" %>
        </div>

        <div id="m_menu">
            <%@include file="../../WEB-INF/jspf/menu.jspf" %>
        </div>

        <div id="cmenu2">
            <%@include file="../../WEB-INF/jspf/submenu.jspf" %>
        </div>

        <div id="cdata">
            <h2 style="text-align: center;margin-bottom: 20px">Asignación de Horarios a Trabajadores</h2>
            <form class="parainfo" action="#" style="margin: auto;display: table">
                <fieldset>
                    <legend>Marcación Masiva</legend>

                    <table style="margin: auto">
                        <tr>

                            <td style="padding-left: 40px">
                                <table>
                                    <tr>
                                        <td>Año</td>
                                        <td>
                                            <select id="annio" onchange="jsannio();" style="width: 320px">
                                                <option value="0">Seleccione...</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Unid. Ejecutora</td>
                                        <td>
                                            <select id="uejecutora" onchange="jsuejecutora();" style="width: 320px">
                                                <option value="0">Seleccione...</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Corte</td>
                                        <td>
                                            <select id="ctlcorte" onchange="jscorte();" style="width: 320px">
                                                <option value="0">Seleccione...</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Dependencia</td>
                                        <td>

                                            <select id="dependencia" onchange="jsdependencia();" style="width: 320px">
                                                <option value="0">Seleccione...</option>
                                            </select>




                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Área Física</td>
                                        <td>
                                            <select id="area" onchange="jsarea();" style="width: 320px">
                                                <option value="0">Todos</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Sede</td>
                                        <td>
                                            <select id="sede" onchange="jssede();" style="width: 320px">
                                                <option value="0">Seleccione...</option>
                                            </select>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td>
                                <table>
                                    <tr>
                                        <td>Nro.&nbsp;Documento</td>
                                        <td>
                                            <input type="text" id="numdoc" 
                                                   maxlength="15" style="width: 100px"/>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" id="idactivo_bus" checked="checked"/> Activo

                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Apellido&nbsp;Paterno</td>
                                        <td colspan="2">
                                            <input type="text" id="appaterno" 
                                                   maxlength="200" style="width: 200px"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Apellido&nbsp;Materno</td>
                                        <td colspan="2">
                                            <input type="text" id="apmaterno" 
                                                   maxlength="200" style="width: 200px"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Nombres</td>
                                        <td colspan="2">
                                            <input type="text" id="nombres" 
                                                   maxlength="200" style="width: 200px"/>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>Reg. Lab.</td>
                                        <td>
                                            <select id="reglab" onchange="jsregimen();" style="width: 320px">
                                                <option value="0">Seleccione...</option>
                                            </select>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <th colspan="2" style="text-align: center;padding-top: 10px">
                                <input type="button" onclick="jsQry();"
                                       value="Buscar"/>
                            </th>
                        </tr>
                    </table>
                </fieldset>
            </form>

            <table style="margin: auto;margin-top: 30px">
                <tr>
                    <td style="vertical-align: top">
                        <table class="parainfo" style="width: 900px">
                            <thead>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>Trabajador</td>
                                    <td>Documento</td>
                                    <td>Dependencia</td>
                                    <td>Área Física</td>
                                    <td>Estado</td>
                                    <td>Horario</td>

                                </tr>
                            </thead>

                            <tbody id="qbody">
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>
                            </tbody>
                        </table>
                    </td>

                    <td style="vertical-align: top">
                        <table class="crud">
                            <tr>
                                <td>
                                    <a href="#" onclick="jsAsigna();" title="Asignar Horario">
                                        <img src="../../images/asigna.png"/></a>
                                </td>
                                <td>
                                    <a href="#" onclick="jsCon();" title="Consultar">
                                        <img src="../../images/find2.png"/></a>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <a href="#" onclick="jsExcel();" title="Exportar a Excel">
                                        <img src="../../images/excel.png"/></a>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

            <%-- para asignar horario  --%>
            <div style="display: none">
                <div id="dasi" title="Asignaci&oacute;n de Horario a Trabajador">
                    <table>
                        <tr>
                            <td>Trabajador</td>
                            <td>
                                <input type="text" id="trabajador_asi" readonly="readonly" 
                                       style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Horario</td>
                            <td>
                                <select id="horarios_asi" onchange="jshorario()"
                                        style="width: 304px">
                                    <option value="0">Seleccione...</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2">Detalle de Horario</td>
                        </tr>
                        <tr>
                            <td class="ui-widget-header">D&iacute;a</td>
                            <td class="ui-widget-header">Turno</td>
                        </tr>
                        <tr>
                            <td>Lunes</td>
                            <td>
                                <input type="text" id="turno_asi_lun" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Martes</td>
                            <td>
                                <input type="text" id="turno_asi_mar" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Mi&eacute;rcoles</td>
                            <td>
                                <input type="text" id="turno_asi_mie" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Jueves</td>
                            <td>
                                <input type="text" id="turno_asi_jue" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Viernes</td>
                            <td>
                                <input type="text" id="turno_asi_vie" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>S&aacute;bado</td>
                            <td>
                                <input type="text" id="turno_asi_sab" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Domingo</td>
                            <td>
                                <input type="text" id="turno_asi_dom" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                    </table>

                    <p id="error_asi" style="color: red"></p>
                </div>
            </div>

            <%-- para consultar horario  --%>
            <div style="display: none">
                <div id="dcon" title="Asignaci&oacute;n de Horario a Trabajador">
                    <table>
                        <tr>
                            <td>Trabajador</td>
                            <td>
                                <input type="text" id="trabajador_con" 
                                       readonly="readonly" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Horario</td>
                            <td>
                                <input type="text" id="horario_con" 
                                       readonly="readonly" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2">Detalle de Horario</td>
                        </tr>
                        <tr>
                            <td class="ui-widget-header">D&iacute;a</td>
                            <td class="ui-widget-header">Turno</td>
                        </tr>
                        <tr>
                            <td>Lunes</td>
                            <td>
                                <input type="text" id="turno_con_lun" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Martes</td>
                            <td>
                                <input type="text" id="turno_con_mar" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Mi&eacute;rcoles</td>
                            <td>
                                <input type="text" id="turno_con_mie" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Jueves</td>
                            <td>
                                <input type="text" id="turno_con_jue" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Viernes</td>
                            <td>
                                <input type="text" id="turno_con_vie" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>S&aacute;bado</td>
                            <td>
                                <input type="text" id="turno_con_sab" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Domingo</td>
                            <td>
                                <input type="text" id="turno_con_dom" 
                                       style="width: 270px" readonly="readonly"/>
                            </td>
                        </tr>
                    </table>

                    <p id="error_asi" style="color: red"></p>
                </div>
            </div>

            <%-- para mensajes  --%>
            <div style="display: none">
                <div id="dmsg" title="Mensaje">
                    <p id="msg" style="text-align: center;color: #800;margin: 20px"></p>
                </div>
            </div>
        </div>

        <%-- para excel  --%>
        <form id="to_excel" action="HorariosXtrabajadorExc" target="_parent" method="post">
            <input type="hidden" id="data_excel" name="data_excel"/>

            <input type="hidden" id="data_excel" name="data_excel"/>
            <input type="hidden" id="anio_excel" name="anio_excel"/>
            <input type="hidden" id="ueje_excel" name="ueje_excel"/>
            <input type="hidden" id="corte_excel" name="corte_excel"/>
            <input type="hidden" id="dependencia_excel" name="dependencia_excel"/>
            <input type="hidden" id="area_excel" name="area_excel"/>
            <input type="hidden" id="sede_excel" name="sede_excel"/>

        </form>
    </body>
</html>

